package db;

public class SQLStatements {
	
	public static final String SID = "event.sid";
	public static final String CID = "event.cid";
	public static final String SIG_ID = "sig_id";
	public static final String SIG_SID = "sig_sid";
	public static final String SIG_NAME = "sig_name";
	public static final String TIMESTAMP = "timestamp";
	public static final String IP_SRC = "ip_src";
	public static final String IP_DST = "ip_dst";

	public static String ALERTS_ICMP_SELECT_ALL = "SELECT DISTINCT "+TIMESTAMP+","+SID+","+CID+","+SIG_ID+","+SIG_SID+","+SIG_NAME+","+IP_SRC+","+IP_DST+" "
			+	"FROM event  "
			+	"INNER JOIN signature ON (event.signature = signature.sig_id) " 
			+	"INNER JOIN icmphdr ON (event.cid=icmphdr.cid AND event.sid=icmphdr.sid) " 
			+	"INNER JOIN iphdr ON (event.cid=iphdr.cid AND event.sid=iphdr.sid) "
			+	"ORDER BY event.timestamp";

	public static String ALERTS_UDP_SELECT_ALL = "SELECT DISTINCT "+TIMESTAMP+","+SID+","+CID+","+SIG_ID+","+SIG_SID+","+SIG_NAME+","+IP_SRC+","+IP_DST+", udp_sport, udp_dport "
			+	"FROM event  "
			+	"INNER JOIN signature ON (event.signature = signature.sig_id) " 
			+	"INNER JOIN udphdr ON (event.cid=udphdr.cid AND event.sid=udphdr.sid) " 
			+	"INNER JOIN iphdr ON (event.cid=iphdr.cid AND event.sid=iphdr.sid) "
			+	"ORDER BY event.timestamp";
	
	public static String ALERTS_TCP_SELECT_ALL = "SELECT DISTINCT "+TIMESTAMP+","+SID+","+CID+","+SIG_ID+","+SIG_SID+","+SIG_NAME+","+IP_SRC+","+IP_DST+", tcp_sport, tcp_dport "
			+	"FROM event  "
			+	"INNER JOIN signature ON (event.signature = signature.sig_id) " 
			+	"INNER JOIN tcphdr ON (event.cid=tcphdr.cid AND event.sid=tcphdr.sid) " 
			+	"INNER JOIN iphdr ON (event.cid=iphdr.cid AND event.sid=iphdr.sid) "
			+	"ORDER BY event.timestamp";

}
